package com.jinxin.platform.cdacscontrolmgr.utils;

import java.util.*;

public class Utils {

    public static String getUuid() {
        UUID uuid = UUID.randomUUID();
        return uuid.toString().replace("-", "");
    }

    /**
     * 获取位数为7位的随机数
     *
     * @return
     */
    public static String getRandom() {
        Random random = new Random();
        int nextInt = random.nextInt(9000000);
        nextInt = nextInt + 1000000;
        return nextInt + "";
    }

    public static String getRandom8() {
        Random random = new Random();
        int nextInt = random.nextInt(90000000);
        nextInt = nextInt + 10000000;
        return nextInt + "";
    }
    // 是否是奇数
    public static boolean isOdd(int num){
        return (num&1)==1;
    }

    // 判断字符串是否全是数字
    public static boolean isNumeric(String str){
        for (int i = 0; i < str.length(); i++){
            if (!Character.isDigit(str.charAt(i))){
                return false;
            }
        }
        return true;
    }


}
